<?php
	session_start();
	include "include.php";
?>
<html>
<head>
<title><?php echo $SITE_TITLE ?> - Reset Password</title>
<link rel="stylesheet" type="text/css" href="main.css" /></head>
<div id="container">
<div id="top">
<h1><?php echo $SITE_TITLE ?></h1>
</div>
<div id="leftnav">
</div>
<div id="content">
<?php
	mysql_connect(DB_HOST,DB_USER,DB_PASSWORD) or die(mysql_error());
	mysql_select_db(DB_NAME);
	$salt = md5(uniqid(rand(), true));
	$salt = substr($salt, 0, 50);
	$sql = "UPDATE users SET users_password='" . md5($salt."temp") . "', users_salt='" . $salt . "' WHERE users_id=" . $_GET["users_id"] . ";";
	$result = mysql_query($sql);
	echo "Password reset.<br><a href=\"" . $SITE_URL . "\">Return to homepage</a>";
?>
</div>
<div id="footer">
<?php include "footer.php" ?>
</div>
</div>
</body>
</html>
